<!--
 * @Author: your name
 * @Date: 2021-09-24 21:34:17
 * @LastEditTime: 2021-09-25 14:30:04
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue_basic\20_单文件组件练习\School.vue
-->
<template>
  <div class="demo">
    <h2>学校的名称：{{ name }}</h2>
    <h2>学校的地址：{{ address }}</h2>
    <button @click="showName">点我输出学校名</button>
  </div>
</template>

<script>
export default {
  name: "School",
  data() {
    return {
      name: "尚硅谷",
      address: "北京",
    };
  },
  methods: {
    showName() {
      alert(this.name)
    },
  },
};
</script>

<style>
.demo {
  background-color: orange;
}
</style>
